package com.example.demo.model.order.order.controler;



import com.example.demo.Results.ResultClass;
//import com.example.demo.model.index.entity.ShopCartReq;
import com.example.demo.model.index.index.entity.ShopCartReq;
import com.example.demo.model.order.order.service.UserOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author STAHYW
 * @since 2021-10-23
 */
@RestController
@RequestMapping("/order/userOrder")
public class UserOrderResource {

    @Autowired
    UserOrderService userOrderService;
    @PostMapping("/goMoney")
    public ResultClass goMoney(@RequestBody List<ShopCartReq> jsonStr, Integer addressId, HttpServletRequest request) {
        return userOrderService.goMoney(jsonStr, addressId,request);
    }

    @GetMapping("/finish")
    public ModelAndView finish(Integer orderId) {
        return userOrderService.finish(orderId);
    }

}


